package com.cskaoyan.user.utils;

import com.cskaoyan.mall.commons.constant.SysRetCodeConstants;
import com.cskaoyan.mall.commons.exception.ValidateException;

/**
 * Auth: 杨宇健
 * Time: 2023/1/9 23:40
 * Description: affect == 0 自动抛数据库异常
 **/
public class AffectValid {
    public static void affectValid(int affect){
        if (affect == 0) {
            //数据库异常
            throw new ValidateException(SysRetCodeConstants.DB_EXCEPTION.getCode(), SysRetCodeConstants.DB_EXCEPTION.getMessage());
        }
    }
}
